import { request } from '@/utils/request';
import { PageParams } from "@/api/model/pageParams";

const page = async (params: PageParams) => {
    return request.post({
        url: '/foodType/page',
        data: params
    });
}

const saveApi = async (data: any) => {
    return request.post({
        url: '/foodType/save',
        data
    });
}

const deleteById = async (id: string) => {
    return request.get({
        url: `/foodType/delete/${id}`,
    });
}

const getOptions = async (id: string) => {
    return request.get({
        url: `/foodType/options`,
    });
}

export {
    page,
    saveApi,
    getOptions,
    deleteById
}
